package com.ylfstu.wrapper_;

/**
 * @author:Joy_Yang
 * @date:2022/9/28
 * @version:1.0
 */
public class WarpperToString {
    public static void main(String[] args) {
        //包装类——>String
        Integer n1 = 100;
        //方式1
        String str1 = n1 + "";
        //方式2
        String str2 = n1.toString();
        //方式3
        String Str3 = String.valueOf(n1);

        //String ---> 包装类(Integer)
        String str4 = "12345";
        Integer integer1 = Integer.parseInt(str4);//使用了自动装箱
        Integer integer = Integer.valueOf(str4);
        Integer integer2 = new Integer(str4);//构造器

        Integer x = 128;//底层 Integer.valueOf(1);
        Integer y = 128;//底层 Integer.valueOf(1);
        System.out.println(x == y);//False




    }
}
